import daily.core.Activity
import daily.core.Person
import daily.securety.Account
import grails.converters.JSON

class BootStrap {

    def init = { servletContext ->
         Person person = new Person(name: 'tt').save(flush: true)
         new Account(name: '55',password: '55', showName:'55', person:person).save(flush: true)


        JSON.registerObjectMarshaller( Activity ) { Activity activity ->
            return [
                    id : activity.id,
                    content : activity.content,
                    start : activity.start.format("yyyy-MM-dd HH:mm:ss"),
                    end : activity.end.format("yyyy-MM-dd HH:mm:ss"),
                    allDay:activity.allDay
            ]
        }

    }
    def destroy = {
    }
}
